package com.atguigu.servlet;


import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 *
 * 监听项目的启动和停止
 *
 * @author 张晓
 * @create 2020-11-30 17:31
 */
public class UserListener implements ServletContextListener {

    //监听ServletContext启动初始化
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        System.out.println("UserListener...contextInitialized...");
    }
    //监听ServletContext销毁
    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {
        ServletContext servletContext = servletContextEvent.getServletContext();
        System.out.println("UserListener...contextDestroyed...");
    }
}
